#include <commands\command.h>
#include <commands\commandFactory.h>

void 
command::tokenizeHeader(const string& str, vector<string>& tokens, const string& delimiter)
{
  string::size_type lastPos = str.find_first_not_of(delimiter, 0);
  string::size_type pos     = str.find_first_of(delimiter, lastPos);

  while (string::npos != pos || string::npos != lastPos)
  {
    tokens.push_back(str.substr(lastPos, pos - lastPos));
    lastPos = str.find_first_not_of(delimiter, pos);
    pos = str.find_first_of(delimiter, lastPos);
  }
}

void 
command::sendBytes(const void *buffer, unsigned int count) {
  connection->sendData((unsigned char *) buffer, count);
}

unsigned int 
command::getTypeId() {
  return type_id;
}

streamingConnection *
command::getconnection() {
  return connection;
}

void 
command::decode(stringstream &bytes_stream, int size) {

};
  
void 
command::execute() {
  
};